
<tabset class="mod-tab">
  <div class="tab-border"></div>
  <tab class="first" heading="工程" active="tabActive[0].active" ui-sref="projectManage.project">
    <div class="mod-project project-manage">
      <div class="project-options">
        <button class="ui-btn ui-btn-lg" ui-sref="createProject1({'projectCollectionId':resourceId})" ng-disabled="!mayCreateProject()" ng-class="{'ui-btn-lg-disabled':!mayCreateProject()}"><span class="btn-txt">新建工程</span><i class="fa fa-plus"></i></button>
        <div class="pull-right"><span ng-cloak="ng-cloak">共{{filteredProjectList.length}}个工程</span>
          <input class="ui-input-search ui-input-fill" type="text" placeholder="输入工程名称查询" ng-model="proKeywards"/>
        </div>
      </div>
      <div class="mod-tips-info">
        <p class="txt-prompt"><i class="fa fa-info-circle icon-algin-right"></i>工程用来配置生成镜像的信息，启动构建后会按照配置执行命令生成镜像并存储倒私有仓库中。</p>
      </div>
      <div class="mod-list">
        <loading ng-if="isLoading"></loading>
        <table class="ui-table-dome">
          <thead>
            <tr>
              <th>工程名称</th>
              <th>构建类型</th>
              <th>构建时间</th>
              <th>构建状态</th>
              <th>代码源</th>
              <th>构建</th>
            </tr>
          </thead>
          <tbody>
            <tr ng-if="filteredProjectList.length===0">
              <td class="text-center" colspan="7">暂无相关工程</td>
            </tr>
            <tr ng-repeat="project in filteredProjectList =  (projectList|filter:{name:proKeywards})">
              <td><a class="ui-table-link" ng-bind="project.name" ui-sref="projectDetail({'projectCollectionId':resourceId,'project':project.id})"></a></td>
              <td ng-switch="project.projectType"><span ng-switch-default="ng-switch-default">未知配置</span><span ng-switch-when="java">Java专属配置</span><span ng-switch-when="dockerfileuserdefined">定制化配置</span><span ng-switch-when="commonconfig">通用配置</span><span ng-switch-when="dockerfileincode">代码内Dockerfile</span></td>
              <td ng-bind="(project.buildTime | day)"></td>
              <td ng-switch="project.buildStatus"><span class="txt-success" ng-switch-when="Success">成功</span><span class="txt-warning" ng-switch-when="Fail">失败</span><span class="txt-error" ng-switch-when="Stopped">已停止</span><span class="txt-normal" ng-switch-when="Building">构建中</span><span class="txt-normal" ng-switch-when="Preparing">准备中</span><span class="txt-normal" ng-switch-when="Send">准备中</span><span ng-switch-default="ng-switch-default">未启动</span></td>
              <td ng-cloak="ng-cloak" ng-switch="project.codeManager"><span ng-if="!project.nameWithNamespace">无</span><a href="{{project.codeHttpUrl}}" target="_blank" ng-show="project.nameWithNamespace" title="代码源"><i class="fa fa-gitlab icon-git-color" ng-switch-when="gitlab"></i><i class="fa fa-github icon-git-color" ng-switch-when="github"></i></a></td>
              <td><a ng-click="openBuild(project.id,!!project.nameWithNamespace)" title="构建"><i class="fa fa-wrench icon-edit-color"></i></a></td>
            </tr>
          </tbody>
        </table>
      </div>
    </div>
  </tab>
  <tab heading="成员" active="tabActive[1].active" ui-sref="projectManage.user">
    <form-container left-column-width="0">
      <form>
        <collection-member-table collection-id="resourceId" collection-type="resourceType" on-role-change="setRole(role)" on-no-permission="exitToList()" help-text="有MASTER权限的成员可以查看、修改、删除项目，可以在项目中添加、查看、修改、删除工程；有DEVELOPER权限的成员可以查看、修改项目，可以在项目中添加、查看、修改工程；有REPORTER权限的成员可以查看项目，可以查看项目中的工程。添加、修改或删除项目成员需要MASTER权限。"></collection-member-table>
      </form>
    </form-container>
  </tab>
</tabset>